package com.ovopark.firecar.utils

/**
 * Created by cz on 2018/6/15.
 */
object NewAddressUtils {
    const val SERVER_WEBSOCKET = 0
    const val SERVER_BOSS = 1
    const val SERVER_SUPPORT = 2
    const val SERVER_FACEPULSIP = 3
    const val SERVER_ZUUL_SERVICE_URL = 4
    const val SERVER_WORK_GROUP_URL = 5
    const val SERVER_SHOP_WEB_URL = 6
    const val SERVER_QR_CODE_URL = 7
    const val SERVER_WANJI_SERVER = 8
    const val SERVER_POS_SERVER = 9
    const val SERVER_WORK_CIRCLE_SERVER = 10
    const val SERVER_SHOP_CREDIT_SERVER = 11
    const val SERVER_CRM_TIANTI_SERVER = 12
    const val SERVER_CRM_TIANTI_H5_SERVER = 13
    const val SERVER_WANJI_MALL_C_SERVER = 14//万集c端商城地址
//    private fun getResult(context: Context): ServerUrlModel {
//        val data = SharedPreferencesUtils.getInstance(Constants.Prefs.SERVER_ADDR)
//            ?.getParam(context, Constants.Prefs.SERVER_NEW_ADDR_KEY, "") as String
//        return JSONObject.parseObject(data, ServerUrlModel::class.java)
//    }

    @JvmStatic
    fun getNewServerUrl(serverType: Int): String {
//        var serverUrl = ""
//        try {
//            val serverUrlModel = getResult(AppDataAttach.getApplicationContext())
//            if (serverUrlModel != null) {
//                when (serverType) {
//                    SERVER_WEBSOCKET -> serverUrl = serverUrlModel.websocketServerUrl
//                    SERVER_BOSS -> serverUrl = serverUrlModel.bossServerUrl
//                    SERVER_SUPPORT -> serverUrl = serverUrlModel.supportServerUrl
//                    SERVER_FACEPULSIP -> serverUrl = serverUrlModel.facePulsPlusIp
//                    SERVER_ZUUL_SERVICE_URL -> serverUrl = serverUrlModel.zuulServerUrl
//                    SERVER_WORK_GROUP_URL -> //                        serverUrl = serverUrlModel.getWorkGroupServerUrl();
//                        //接口迁移，使用新地址
//                        serverUrl =
//                            DataManager.getInstance().baseUrl + "ovopark-handoverbook-server/"
//                    SERVER_SHOP_WEB_URL -> serverUrl = serverUrlModel.shopwebUrl
//                    SERVER_QR_CODE_URL -> serverUrl = serverUrlModel.qrCodeServerUrl
//                    SERVER_WANJI_SERVER -> serverUrl = serverUrlModel.wanjiServerUrl
//                    SERVER_POS_SERVER -> serverUrl = serverUrlModel.businessServer
//                    SERVER_WORK_CIRCLE_SERVER -> serverUrl = serverUrlModel.workcircleServerUrl
//                    SERVER_SHOP_CREDIT_SERVER -> serverUrl = serverUrlModel.loanUrl
//                    SERVER_CRM_TIANTI_SERVER -> serverUrl = serverUrlModel.crmTiantiServerUrl
//                    SERVER_CRM_TIANTI_H5_SERVER -> serverUrl = serverUrlModel.crmTiantiH5ServerUrl
//                    SERVER_WANJI_MALL_C_SERVER -> serverUrl = serverUrlModel.wjcServerUrl
//                    else -> {
//                    }
//                }
//            }
//        } catch (e: Exception) {
//            e.printStackTrace()
//        }
//        if (serverUrl == null) {
//            serverUrl = ""
//        }
        return "ws://121.43.123.76:8088/shopweb-websocket/websocket"
    }
}